/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cratos.xxgram.platf.message;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;

import org.redkale.convert.json.JsonConvert;
import org.redkale.util.Comment;
import org.redkale.util.Utility;

/**
 * 通知类消息
 *
 * @author SquRab
 */
public abstract class NotifyContent extends BaseContent {

     @Comment("提示小灰条通知消息")
    public static final short OBJ_INFO_NTF = 2001;

    @Comment("联系人(好友)通知消息 用来发送联系人操作（加好友等）的通知消息")
    public static final short OBJ_CONTRACT_NTF = 2002;

    @Comment("联系人(好友)通知消息 用来发送联系人操作（加好友等）的通知消息")
    public static final short OBJ_CONTRACT_LOCAL_NTF = 2003;

    @Comment("已读通知消息")
    public static final short OBJ_READ_NTF = 2004;

    @Comment("新建群")
    public static final short OBJ_CREATE_GROUP_NTF = 2005;

    @Comment("更新群")
    public static final short OBJ_UPDATE_GROUP_NTF = 2006;

    @Comment("添加群成员")
    public static final short OBJ_ADD_MEMBER_GROUP_NTF = 2007;

    @Comment("踢出群成员")
    public static final short OBJ_KICK_GROUP_NTF = 2008;

    @Comment("退出群")
    public static final short OBJ_QUIT_GROUP_NTF = 2009;

    @Comment("解散群")
    public static final short OBJ_DISMISS_GROUP_NTF = 2010;
    
    @Comment("更新用户群昵称")
    public static final short OBJ_UPDATE_USERNICKNAME_NTF = 2011;
    
    @Comment("对好友进行隐身")
    public static final short OBJ_STEALTH_WITHFRIEND_NTF = 2013;
    
    @Comment("用户在线状态")
    public static final short OBJ_ONLINE_STATUS_NTF = 2014;
    
     @Comment("删除好友事件")
    public static final short OBJ_REMOVE_FRIEND_NTF = 2015;

    @Comment("撤回消息")
    public static final short OBJ_RECALL_MESSAGE_NTF = 2016;
    
    @Comment("撤回全部消息")
    public static final short OBJ_RECALLALL_MESSAGE_NTF = 2017;
    
    @Comment("用户登录后获取 好友，群 在线用户列表")
    public static final short OBJ_ONLINE_USERLIST_NTF = 2018;
    
    @Comment("群禁言")
    public static final short OBJ_FORBIDDENWORD_NTF = 2019;
 
    @Comment("登出H5端")
    public static final short OBJ_LOGOUT_WEBCLI = 2020;
    
    @Comment("输入状态 阅读状态")
    public static final short OBJ_INPTORREAD_STATE_NTF = 2021;
    
    @Comment("App显示 H5退出登录")
    public static final short OBJ_DISABLEAPP_H5 = 2022;
    
    @Comment("群消息已读")
    public static final short OBJ_GROUP_READ_RECEIPT_NTF = 2023;
    
    @Comment("更新群类型")
    public static final short OBJ_GROUP_UPDATE_TYPE_NTF = 2024;
    
    
    @Comment("更用户头像新群")
    public static final short OBJ_UPDATE_USERFACE_NTF = 2025;
    
    
    @Comment("多端消息同步")
    public static final short OBJ_SYNMULTERNAL_MESSAGE = 2026;
    
    @Comment("App显示 H5在线通知")
    public static final short OBJ_ONLINE_APP_H5 = 2027;
    
    @Comment("更新密性配置")
    public static final short OBJ_SECRET_SETTING = 2028;
    /**
     * 提示小灰条通知消息
     *
     * @author SquRab
     */
    public static class InformationNotificationMessage extends NotifyContent {

        @Comment("提示小灰条通知消息")
        public transient static final short TYPE = OBJ_INFO_NTF;

        @Comment("提示条消息内容。")
        private String message;

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

    }

    /**
     *
     * @author SquRab
     */
    @Comment("联系人(好友)通知消息 用来发送联系人操作（加好友等）的通知消息，客户端收到消息后进行存储，不计入未读消息数，此类型消息没有 Push 通知。 RC:ContactNtf")
    public static class ContactNotificationMessage extends NotifyContent {

        @Comment("联系人(好友)通知消息 用来发送联系人操作（加好友等）的通知消息")
        public transient static final short TYPE = OBJ_CONTRACT_NTF;

        @Comment("请求")
        public static final String OPERATION_REQ = "Request";

        @Comment("接受")
        public static final String OPERATION_ACCEPT_RSP = "AcceptResponse";

        @Comment("拒绝")
        public static final String OPERATION_REJECT_RSP = "RejectResponse";

        @Comment("忽略")
        public static final String OPERATION_IGNORE_RSP = "IgnoreResponse";
        
        private String operation = "";

        @Comment("申请人id")
        private int fromUserId;

        @Comment("被申请用户id")
        private int targetUserId;

        @Column(comment = "申请好友方式; 10:手机搜索; 20:扫二维码;")
        private short invitetype;

        private String message;

        @Comment("userid+“-”+friendid+“-”+create36time ")
        private String friendaskid;

        public String getFriendaskid() {
            return friendaskid;
        }

        public void setFriendaskid(String friendaskid) {
            this.friendaskid = friendaskid;
        }

        
        public int getFromUserId() {
            return fromUserId;
        }

        public short getInvitetype() {
            return invitetype;
        }

        public void setInvitetype(short invitetype) {
            this.invitetype = invitetype;
        }

        public void setFromUserId(int fromUserId) {
            this.fromUserId = fromUserId;
        }

        public int getTargetUserId() {
            return targetUserId;
        }

        public void setTargetUserId(int targetUserId) {
            this.targetUserId = targetUserId;
        }

        
        
        public String getOperation() {
            return operation;
        }

        public void setOperation(String operation) {
            this.operation = operation;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    /**
     * 已读通知消息
     */
    public static class ReadReceiptMessage extends NotifyContent {

        @Comment("资料通知消息")
        public transient static final short TYPE = OBJ_READ_NTF;

        @Comment("最后一条消息的发送时间。")
        private long lastMessageSendTime;

        @Comment("最后一条消息的 UId。")
        private String messageId = "";

        @Comment("会话创建时间 便于更新消息时 确认表的范围")
        private long cvsationtime;
        
        @Comment("消息类型。")
        private short type;

        public long getLastMessageSendTime() {
            return lastMessageSendTime;
        }

        public void setLastMessageSendTime(long lastMessageSendTime) {
            this.lastMessageSendTime = lastMessageSendTime;
        }

        public String getMessageId() {
            return messageId;
        }

        public void setMessageId(String messageId) {
            this.messageId = messageId;
        }

        public int getType() {
            return type;
        }

        public void setType(short type) {
            this.type = type;
        }

        public long getCvsationtime() {
            return cvsationtime;
        }

        public void setCvsationtime(long cvsationtime) {
            this.cvsationtime = cvsationtime;
        }

        
    }

    @Comment("新建群")
    public static class CreateGroupNotify extends NotifyContent {

        @Comment("新建群")
        public transient static final short TYPE = OBJ_CREATE_GROUP_NTF;

        public transient static final String OP_MSG = "%s创建群成功!";

        @Comment("普通群")
        public static final  short  GROUP_TYPE_NORMAL = 10;

        @Comment("匿名群")
        public static final  short  GROUP_TYPE_ANONYMOUS = 20;

        @Comment("群名称")
        private String targetGroupName = "";

        @Comment("加入的用户id")
        private Integer[] userIds;

        @Comment("群类型")
        private short grouptype;
        
        @Comment("消息内容。")
        private String message;

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
             
        public Integer[] getUserIds() {
            return userIds;
        }

        public void setUserIds(Integer[] userIds) {
            this.userIds = userIds;
        }

        public String getTargetGroupName() {
            return targetGroupName;
        }

        public void setTargetGroupName(String targetGroupName) {
            this.targetGroupName = targetGroupName;
        }

        public short getGrouptype() {
            return grouptype;
        }

        public void setGrouptype(short grouptype) {
            this.grouptype = grouptype;
        }
        
    }

    @Comment("更新群")
    public static class UpdateGroupNotify extends NotifyContent {

        @Comment("更新群")
        public transient static final short TYPE = OBJ_UPDATE_GROUP_NTF;

        public transient static final String OP_MSG = "%s更新群信息成功!";

        @Comment("更新群公告")
        public transient static final int UPDATE_NOTICE = 10;
        
        @Comment("更新群名称")
        public transient static final int UPDATE_GROUP_NAME = 20;

        @Comment("群Id")
        private int groupId;
        
        @Comment("群公告。")
        private String groupNotice;
        
        @Comment("群名称")
        private String groupName = "";

        @Comment("消息内容。")
        private String message;
         
        @Comment("10 更新群公告 20 更新群名称")
        private int opType;

        public int getGroupId() {
            return groupId;
        }

        public void setGroupId(int groupId) {
            this.groupId = groupId;
        }
        
        public int getOpType() {
            return opType;
        }

        public String getGroupNotice() {
            return groupNotice;
        }

        public void setGroupNotice(String groupNotice) {
            this.groupNotice = groupNotice;
        }

        public String getGroupName() {
            return groupName;
        }

        public void setGroupName(String groupName) {
            this.groupName = groupName;
        }
        
        public void setOpType(int opType) {
            this.opType = opType;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
        

    }

    @Comment("加入群")
    public static class AddMemberToGroupNotify extends NotifyContent {

        @Comment("新建群")
        public transient static final short TYPE = OBJ_ADD_MEMBER_GROUP_NTF;

        @Comment("主动加群")
        public transient static final short JOIN_BY_OWNER = 10;
        
        @Comment("被别人拉入群")
        public transient static final short PULL_BY_OTHER = 20;

        @Comment("10 主动加群  20 拉人入群")
        private short joinType;

        @Comment("群ID")
        private int groupId;

        @Comment("消息内容。")
        private String message;


        private int[] targetUserIds;

        private List<String> targetUserNames;

        public List<String> getTargetUserNames() {
            return targetUserNames;
        }

        public void setTargetUserNames(List<String> targetUserNames) {
            this.targetUserNames = targetUserNames;
        }

        public short getJoinType() {
            return joinType;
        }

        public void setJoinType(short joinType) {
            this.joinType = joinType;
        }
   

        public int getGroupId() {
            return groupId;
        }

        public void setGroupId(int groupId) {
            this.groupId = groupId;
        }


        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public int[] getTargetUserIds() {
            return targetUserIds;
        }

        public void setTargetUserIds(int[] targetUserIds) {
            this.targetUserIds = targetUserIds;
        }
      
        
    }

    // KickedGroup
    @Comment("踢人出群")
    public static class KickedGroupNotify extends NotifyContent {

        @Comment("新建群")
        public transient static final short TYPE = OBJ_KICK_GROUP_NTF;

        @Comment("被踢出去的用户ID")
        private int [] targetUserIds;

        private List<String> targetUserNames;

        @Comment("群ID")
        private int groupId;

        public int getGroupId() {
            return groupId;
        }

        public void setGroupId(int groupId) {
            this.groupId = groupId;
        }
        
        public int[] getTargetUserIds() {
            return targetUserIds;
        }

        public void setTargetUserIds(int[] targetUserIds) {
            this.targetUserIds = targetUserIds;
        }
       
        public List<String> getTargetUserNames() {
            return targetUserNames;
        }

        public void setTargetUserNames(List<String> targetUserNames) {
            this.targetUserNames = targetUserNames;
        }
        
        
 
   }

    @Comment("退出群")
    public static class QuitGroupNotify extends NotifyContent {

        @Comment("退出群")
        public transient static final short TYPE = OBJ_QUIT_GROUP_NTF;

        @Comment("群ID")
        private int groupId;
        
        @Comment("新群主ID")
        private int newCreatorId;

        public int getGroupId() {
            return groupId;
        }

        public void setGroupId(int groupId) {
            this.groupId = groupId;
        }

        public int getNewCreatorId() {
            return newCreatorId;
        }

        public void setNewCreatorId(int newCreatorId) {
            this.newCreatorId = newCreatorId;
        }
        
    }

    @Comment("解散群")
    public static class DissMissGroupNotify extends NotifyContent {

        @Comment("新建群")
        public transient static final short TYPE = OBJ_DISMISS_GROUP_NTF;

        @Comment("消息内容。")
        private String message;

        @Comment("群ID")
        private int groupId;

        public int getGroupId() {
            return groupId;
        }

        public void setGroupId(int groupId) {
            this.groupId = groupId;
        }
        
        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

    }
    
    @Comment("更新用户群昵称")
    public static final class UpdateUserGroupNameNotify extends NotifyContent {
        
        @Comment("用户群昵称")
        public transient static final short TYPE = OBJ_UPDATE_USERNICKNAME_NTF;
        
        @Comment("修改用户昵称")
        public transient static final int UPDATE_NICKNAME = 10;
        
        @Comment("修改聊天背景")
        public transient static final int UPDATE_CHAT_BACKGROUND = 20;
        
        @Comment("10 昵称 20 聊天背景 ")
        private int updatetype;
        
        @Comment("群ID")
        private int groupId;
        
        @Comment("用户聊天背景")
        private String chatbackground;

        @Comment("用户群昵称")
        private String userNickName;
        
        public int getUpdatetype() {
            return updatetype;
        }

        public void setUpdatetype(int updatetype) {
            this.updatetype = updatetype;
        }

        
        public String getChatbackground() {
            return chatbackground;
        }

        public void setChatbackground(String chatbackground) {
            this.chatbackground = chatbackground;
        }
        
        
        public int getGroupId() {
            return groupId;
        }

        public void setGroupId(int groupId) {
            this.groupId = groupId;
        }
 
        public String getUserNickName() {
            return userNickName;
        }

        public void setUserNickName(String userNickName) {
            this.userNickName = userNickName;
        }
        
    }

     

     @Comment("对好友进行隐身")
      public static final class StealthWithFriendsNotify extends NotifyContent  {
        
        @Comment("对好友进行隐身")
        public transient static final short TYPE = OBJ_STEALTH_WITHFRIEND_NTF;
        
        @Comment(" 好友对自己正常显示在线状态")
        public static final short REL_STATUS_NORMAL = 10;

        @Comment(" 好友对自己隐身了")
        public static final short REL_STATUS_STEALTH = 20;

        @Comment("对好友的状态  ")
        private short relstatus;

        @Comment("需要隐身的好友列表")
        private List<Integer> friendids;
      

		public List<Integer> getFriendids() {
			return friendids;
		}

		public void setFriendids(List<Integer> friendids) {
			this.friendids = friendids;
		}

		public short getRelstatus() {
            return relstatus;
        }

        public void setRelstatus(short relstatus) {
            this.relstatus = relstatus;
        }
        
     }
     
     
     @Comment("用户在线状态")
     public static final class UserOnlineStatusNotify extends NotifyContent {
       
         @Comment("用户在线状态")
        public transient static final short TYPE = OBJ_ONLINE_STATUS_NTF;
         
        @Comment("用户在线状态")
        public static final short ONLINE_STATUS_ONLINE = 20;

        @Comment("用户离线状态")
        public static final short ONLINE_STATUS_OFFLINE = 10;
        
        private int userid;
        
        private short onlinestatus;

        public short getOnlinestatus() {
            return onlinestatus;
        }

        public void setOnlinestatus(short onlinestatus) {
            this.onlinestatus = onlinestatus;
        }

        public int getUserid() {
            return userid;
        }

        public void setUserid(int userid) {
            this.userid = userid;
        }
        
     }
     
      @Comment("在线用户列表")
     public static final class OnlineUserListNotify extends NotifyContent {
       
         @Comment("用户在线状态")
        public transient static final short TYPE = OBJ_ONLINE_USERLIST_NTF;
         
        @Comment("好友用户在线状态")
        public static final short FRIEND_LIST_ONLINE = 10;

        @Comment("群用户在线状态")
        public static final short GROUPUSER_LIST_ONLINE = 20;
        
        @Comment("在线好友id列表")
        private HashSet<Integer> userids;
        
        @Comment("在线类型 10 好友列表  20 群中的好友列表")
        private short objType;

        public HashSet<Integer> getUserids() {
            return userids;
        }

        public void setUserids(HashSet<Integer> userids) {
            this.userids = userids;
        }

        public short getObjType() {
            return objType;
        }

        public void setObjType(short objType) {
            this.objType = objType;
        }
      
        
        
     }
      
      /**
     *
     * @author SquRab
     */
    @Comment("删除好友")
    public static class ContactRemoveFriendNotify extends NotifyContent {

        @Comment("删除好友")
        public transient static final short TYPE = OBJ_REMOVE_FRIEND_NTF;

        @Comment("申请人id")
        private int fromUserId;

        @Comment("被申请用户id")
        private int targetUserId;

        public int getFromUserId() {
            return fromUserId;
        }

        public void setFromUserId(int fromUserId) {
            this.fromUserId = fromUserId;
        }

        public int getTargetUserId() {
            return targetUserId;
        }

        public void setTargetUserId(int targetUserId) {
            this.targetUserId = targetUserId;
        }
        
        
    }
    
      /**
     *
     * @author SquRab
     */
    @Comment("撤回消息")
    public static class ReCallNotify extends NotifyContent {

        @Comment("撤回消息")
        public transient static final short TYPE = OBJ_RECALL_MESSAGE_NTF;

        @Comment("被撤回的消息id")
        private String recallmsgid;

        public String getRecallmsgid() {
            return recallmsgid;
        }

        public void setRecallmsgid(String recallmsgid) {
            this.recallmsgid = recallmsgid;
        }
        
    }
     
    /**
     * @author SquRab
     */
    @Comment("撤回全部消息")
    public static class ReCallAllNotify extends NotifyContent {

        @Comment("撤回消息")
        public transient static final short TYPE = OBJ_RECALLALL_MESSAGE_NTF;

        @Comment("被撤回的消息id")
        public int targetid;
        
        @Comment("开始时间")
        public long starttime;

        public int getTargetid() {
            return targetid;
        }

        public void setTargetid(int targetid) {
            this.targetid = targetid;
        }

        public long getStarttime() {
            return starttime;
        }

        public void setStarttime(long starttime) {
            this.starttime = starttime;
        }
        
        public static void main(String[] args) {
            ReCallAllNotify c = JsonConvert.root().convertFrom(ReCallAllNotify.class, "{\"targetid\":300000022,\"starttime\":1587113065256}");
        }
        
    }
    
        
    @Comment("全员禁言")
    public static final class ForBiddenWordNotify extends NotifyContent  {
      
        @Comment("禁言")
        public transient static final short TYPE = OBJ_FORBIDDENWORD_NTF;

        private short status; // 10 禁言关闭 20 禁言
        
        public short getStatus() {
            return status;
        }

        public void setStatus(short status) {
            this.status = status;
        }
      
   }
    
    @Comment("H5 登出")
    public static final class LogOutH5Notify extends NotifyContent  {
      
        @Comment("H5 登出")
        public transient static final short TYPE = OBJ_LOGOUT_WEBCLI;
        
   }
    @Comment("APP 端显示 不在线")
    public static final class DisableH5Status extends NotifyContent  {
      
        @Comment("APP 端显示 不在线")
        public transient static final short TYPE = OBJ_DISABLEAPP_H5;
        
   }
    
    @Comment("APP 端显示H5 在线")
    public static final class OnlineH5Status extends NotifyContent  {
      
        @Comment("APP 端显示 不在线")
        public transient static final short TYPE = OBJ_ONLINE_APP_H5;
        
   }
    
    
    @Comment("输入状态  阅读状态")
    public static final class InputReadStateNotify extends NotifyContent  {
      
        @Comment("输入状态  阅读状态")
        public transient static final short TYPE = OBJ_INPTORREAD_STATE_NTF;
        
        @Comment("当前状态 10 正在输入  20 正在阅读")
        private int status = 10;
        
        public static final int INPUT_STATE = 10;
        
        public static final int READ_STATE = 20;

		public int getStatus() {
			return status;
		}

		public void setStatus(int status) {
			this.status = status;
		}
        
   }
    
    /**
     * 群消息已读通知消息
     */
    public static class GroupReadReceiptNotify extends NotifyContent {

        @Comment("群消息已读通知消息")
        public transient static final short TYPE = OBJ_GROUP_READ_RECEIPT_NTF;

        @Comment("消息id")
        private Set<String> messageids = new HashSet<String>();
     
     
		public Set<String> getMessageids() {
			return messageids;
		}

		public void setMessageids(Set<String> messageids) {
			this.messageids = messageids;
		}

    }
    
    @Comment("更新群类型")
    public static class GroupUpdateTypeNotify extends NotifyContent {

        @Comment("群消息已读通知消息")
        public transient static final short TYPE = OBJ_GROUP_UPDATE_TYPE_NTF;
     
        @Comment("群类型")
        private int grouptype;

        @Comment("普通群")
        public static final  short  GROUP_TYPE_NORMAL = 10;
        
        @Comment("匿名群")
        public static final  short  GROUP_TYPE_ANONYMOUS = 20;

		public int getGrouptype() {
			return grouptype;
		}
		
		public boolean isAnnoymousGroup() {
			return GROUP_TYPE_ANONYMOUS == grouptype;
		}
		public void setGrouptype(int grouptype) {
			this.grouptype = grouptype;
		}
        
    }
    
    @Comment("更新头像")
    public static class UpdateFaceNotify extends NotifyContent {

        @Comment("更新头像")
        public transient static final short TYPE = OBJ_UPDATE_USERFACE_NTF;
     
    }
    
    @Comment("多端消息同步")
    public static class SynMulTermalNotify extends NotifyContent {

        @Comment("群消息已读通知消息")
        public transient static final short TYPE = OBJ_SYNMULTERNAL_MESSAGE;
     
        @Comment("原消息类型")
        private int parentmsgtype;
        
        @Comment("消息内容")
        public BaseContent content;

        @Comment("父消息id")
        private String parentmsgid;
        
        public int getParentmsgtype() {
                return parentmsgtype;
        }

        public void setParentmsgtype(int parentmsgtype) {
                this.parentmsgtype = parentmsgtype;
        }

        public BaseContent getContent() {
                return content;
        }

        public void setContent(BaseContent content) {
                this.content = content;
        }

        public String getParentmsgid() {
            return parentmsgid;
        }

        public void setParentmsgid(String parentmsgid) {
            this.parentmsgid = parentmsgid;
        }

        
        /**
         * 产生新对象
         * @param msgRecord
         * @return 
         */
        public static MessageRecord fromMessageRecord(MessageRecord msgRecord) {
                MessageRecord record = msgRecord.copy();
                SynMulTermalNotify mulTermalNotify = new SynMulTermalNotify();
                mulTermalNotify.setContent(record.getContentObj());
                mulTermalNotify.setParentmsgtype(record.getMsgtype());//原始消息类型
                mulTermalNotify.setParentmsgid(msgRecord.getMessageid());//父消息id
                record.setMsgtype(TYPE);
                record.setContentObj(mulTermalNotify);
                record.setEncrypt(MessageRecord.ENCRYPT_DISABLE);
                record.setContent(JsonConvert.root().convertTo(mulTermalNotify));
                //
                record.setFromid(record.getFromid());
                record.setTargetid(record.getTargetid());
                record.setMessageid(record.getFromid() + "-" + record.getTargetid() +"-" + Utility.format36time(System.currentTimeMillis()));
                return record;
        }
                
        public static void main(String[] args) {
            MessageRecord record = JsonConvert.root().convertFrom(MessageRecord.class, "{\"clienttype\":\"WEB\",\"content\":\"{\\\"targetid\\\":300000022,\\\"starttime\\\":1587112646457}\",\"createtime\":1587112660863,\"encrypt\":10,\"fromid\":300000014,\"messageid\":\"300000014-300000022-0k93xwepr\",\"msgkind\":20,\"msgtype\":2017,\"status\":10,\"targetid\":300000022}");
            MessageRecord r = fromMessageRecord(record);
            System.out.println("r" + r);
        }
    }
    
    /**
     * 更新密信配置
     * @author fk
     *
     */
    public static class UpdateSecretSetting extends NotifyContent {
    	
    	  @Comment("群消息已读通知消息")
          public transient static final short TYPE = OBJ_SECRET_SETTING;
    	  
    	  // 新增
    	  public static final int OP_ADD = 10;
    	  
    	  // 删除
    	  public static final int OP_REMOVE = 20;
    	  
    	  private int createuser;
    	  
    	  private String secret;
    	  
    	  
    	  private int operator = OP_ADD;
    	  
    	  
    	  public int getCreateuser() {
			return createuser;
		}


		public void setCreateuser(int createuser) {
			this.createuser = createuser;
		}

		

		public String getSecret() {
			return secret;
		}


		public void setSecret(String secret) {
			this.secret = secret;
		}


		public int getOperator() {
			return operator;
		}


		public void setOperator(int operator) {
			this.operator = operator;
		}


		/**
		 * 创建密性通知
		 * @param createuser
		 * @param operator
		 * @return
		 */
		public static UpdateSecretSetting from(int createuser, int operator, String secret) {
    		  UpdateSecretSetting setting = new UpdateSecretSetting();
    		  setting.setCreateuser(createuser);
    		  setting.setOperator(operator);
    		  setting.setSecret(secret);
    		  return  setting;
    	}
    }
}
